package com.example.mapper;

import com.example.entity.ExamManualQuestion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ExamManualQuestionMapper {

    // 根据 ID 查询
    ExamManualQuestion selectExamManualQuestionById(Integer id);

    // 批量插入
    void batchInsertExamManualQuestions(@Param("list") List<ExamManualQuestion> questions);

    // 根据 QSNAIR_ID 查询记录
    List<ExamManualQuestion> selectExamManualQuestionsByQsnairId(@Param("qsnairId") Integer qsnairId);

    // 根据 qsnairId 删除试题
    void deleteExamManualQuestionByQsnairId(@Param("qsnairId") Integer qsnairId);


    // 批量删除题目
    int batchDeleteExamManualQuestionsByPaperIdAndQsIds(Map<String, Object> params);

    // 更新单个题目
    int updateExamManualQuestionByPaperIdAndQsId(ExamManualQuestion question);

}
